#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <queue>

using namespace std;
using LL = long long;
using PII = pair<int, int>;

const int N = 2e5 + 10;

int n;
int q[N];
bool st[N];


int main(){
#ifdef LOCALFLAG
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif


    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;
    for(int i = 1; i <= n; i ++) cin >> q[i];

    for(int i = 1; i <= n; i ++){
        if(!st[i]){
            st[q[i]] = true;
        }
    }

    int cnt = 0;
    vector<int> res;
    for(int i = 1; i <= n; i ++) {
        if(!st[i]){
            cnt ++; 
            res.push_back(i);
        }
    }
    cout << cnt << '\n';
    for(int i = 0; i < res.size(); i ++){
        cout << res[i] << " ";
    }
    cout << '\n';

    return 0;
}